#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/3/28 19:00
# @Author  : Grayson Liu
# @Email   : graysonliu@foxmail.com
# @File    : CustomSignal.py

from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QTableWidget
from CustomFigureCanvas import CustomFigureCanvas

import numpy as np


class CustomSignal(QObject):
    """
    自定义Signal类，包含多种自定义信号
    """
    # 自定义信号，用于在指定CustomFigureCanvas中更新图像，图像矩阵由np.ndarray确定
    draw_picture = pyqtSignal(CustomFigureCanvas, np.ndarray)
    # 自定义信号，用于在指定QTextEdit中刷新文字，文字内容由str确定
    update_text = pyqtSignal(str)
    # 自定义信号，用于在指定QTableWidget中添加一行，内容由str确定
    append_item = pyqtSignal(QTableWidget, str, str)
    # 自定义信号，用于在指定QTableWidget中删除所有行
    clear_all_item = pyqtSignal(QTableWidget)
    # 自定义信号，从方法向导对话框向主窗体发送，用于告知主窗体更新
    add_method = pyqtSignal(str, int, int, list)
    # 自定义信号，从CustomMethodListWidget的”删除“按钮发送，用于告知主窗体删除了一项方法
    delete_method = pyqtSignal(int)
    # 自定义信号，从编辑输入对话框向主窗体发送，用于告知主窗体更新
    set_input = pyqtSignal(dict)
    # 自定义信号，从编辑输出对话框向主窗体发送，用于告知主窗体更新
    set_output = pyqtSignal(dict)
    # 自定义信号，从编辑输出对话框向主窗体发送，用于告知主窗体更新
    set_preprocess = pyqtSignal(dict)

    set_parameter_range = pyqtSignal(list)

    complete_read_graphic = pyqtSignal()

    complete_process = pyqtSignal()

    draw_ndvi_figure = pyqtSignal(list, list)

